/**
 * 获取分页查询时开始rowNumber和结束rowNumber 工具类
 */
package com.etrans.util;

 
public class RowNumUtil {

	/**
	 * 获取分页查询时开始rowNumber
	 * @param fromPage
	 * @param pageSize
	 * @return
	 */
	public static Integer getFromRowNum(int fromPageNum,int pageSizeNum){
		
		Integer fromRow = 0;
	 
		if(fromPageNum > 0 && pageSizeNum > 0){
			fromRow = (fromPageNum - 1) * pageSizeNum + 1;
		}
		
		return fromRow;
	}
	
	/**
	 * 获取分页查询时结束rowNumber
	 * @param toPage
	 * @param pageSize
	 * @return
	 */
	public static Integer getToRowNum(int toPageNum,int pageSizeNum){
		Integer toRow = 0;
		 
		
		if(toPageNum > 0 && pageSizeNum > 0){
			toRow = toPageNum * pageSizeNum;
		}
		
		return toRow;
	}
	
}
